home *** CD-ROM | disk | FTP | other *** search
- ;FILE:CURDIR PURPOSE:To return current default dir on Drive N.
- ;USAGE: CALL CURDIR (N%,A$)
- ;You must pass an integer to indicate drive 0=Default, 1=A, 2=B, 3=C ..
- ;You must pass a string padded with any 64 chars for pathname.
- ;Paramter 2=BP+06, 1=BP+0A
- program segment
- assume cs:program
- push bp ;Save this, we have to, it's the law
- mov bp,sp ;Okay, let's use BP to point to stack
- push es ;We're going to be using this, so save it!
- push ds ;This too.
-
- les di,[bp+06h] ;Move 32bit pointer to string's descripter is +0/+1=Length +2/+3=offset
- mov dx,ds:[0] ;DS:[0] always holds segment of the strings data.
- ;Let's set string's data seg to DS.
- push dx ;
- pop ds ;DS is now the segment containing the strings data.
- mov si,es:[di+2] ;+2 is the address of string data.
-
- les di,[bp+0ah] ;Okay, load 32bit pointer to where integer is.
- mov dx,es:[di] ;Okay, now move the integer HI/LO to DX
-
- mov ah,047h ;Request A Get_Cur_Directory
- int 021h ;MSDOS IRQ
-
- pop ds ;Cleanup now.
- pop es
- pop bp
- program ends
- end